<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
</body>
<script>
    //... 运算符 将数组转为[参数序列]
    //... 也可以实现深拷贝
    const ZHANGSAN = ["1", "2"];
    console.log(...ZHANGSAN);
    //应用场景
    const A = ["1", "2"];
    const B = ["3", "4"];
    let c = [...A, ...B]; //进行两个数组合并
    console.log(c);

    //深拷贝
    const D = [...A];
    D[0] = '5'
    console.log(A);
    console.log(D);
    //将DOM的伪数组变成真正意义上的数组
    let divs = document.getElementsByTagName('div');
    console.log(divs);
    const divArr = [...divs]
    console.log(divArr);

    //...运算符 将数组转为[参数序列]
    //...也可以实现深拷贝
    const arr = ["1", "2"];
    console.log(...arr);
    //应用场景
    const A = ["1", "2"]
    const B = ["3", "4"]
    let c = [...A, ...B] //进行两个数组合并
    console.log(c);

    //深拷贝
    const D = [...A]
    D[0] = '7'
    console.log(A);
    console.log(D);

    //将DOM的伪数组变成真正意义上的数组
    let divs = document.getElementsByTagName('div')
    console.log(divs);
    const divArr = [...divs]
    console.log(divArr);

    //...运算符 将数组转为[参数序列]
    //...也可以实现深拷贝
    const arr = ["1", "2"]
    console.log(...arr);
    //应用场景
    const A = ["1", "2"];
    const B = ["3", "4"];
    let c = [...A, ...B] //合并两个数组
    console.log(c);

    //深拷贝
    const D = [...A]
    D[0] = '9'
    console.log(A);
    console.log(D);

    //将DOM的伪数组变成真正意义上的数组
    let divs = document.getElementsByTagName('div')
    console.log(divs)
    const arrs = [...divs];
    console.log(arrs);
</script>

</html>